|
Code Access Security (CAS), in the Microsoft .NET framework, is Microsoft's solution to prevent untrusted code from performing privileged actions. When the CLR loads an assembly it will obtain evidence for the assembly and use this to identify the code group that the assembly belongs to. A code group contains a permission set (one or more permissions). Code that performs a privileged action will perform a code access demand which will cause the CLR to walk up the call stack and examine the permission set granted to the assembly of each method in the call stack. The code groups and permission sets are determined by the administrator of the machine who defines the security policy. ==Evidence== Evidence can be any information associated with an assembly. The default evidences that are used by .NET code access security are: *Application directory: the directory in which an assembly resides. *Publisher: the assembly's publisher's digital signature (requires the assembly to be signed via Authenticode). *URL: the complete URL where the assembly was launched from *Site: the hostname of the URL/Remote Domain/VPN. *Zone: the security zone where the assembly resides *Hash: a cryptographic hash of the assembly, which identifies a specific version. *Strong Name: a combination of the assembly name, version and public key of the signing key used to sign the assembly. The signing key is not an X509 certificate, but a custom key pair generated by the strong naming tool, SN.EXE or by Visual Studio. A developer can use custom evidence (so-called assembly evidence) but this requires writing a security assembly and in version 1.1 of .NET this facility does not work. Evidence based on a hash of the assembly is easily obtained in code. For example in C#, evidence may be obtained by the following code clause: this.GetType().Assembly.Evidence 抄文引用元・出典: フリー百科事典『 ウィキペディア(Wikipedia)』 ■ウィキペディアで「Code Access Security」の詳細全文を読む スポンサード リンク
|